#ifndef __MYSOCKETSERVER_INTERFACE_H__
#define __MYSOCKETSERVER_INTERFACE_H__

#include "iotgo_memory_hooks.h"
#include "iotgo_platformAPI.h"
#include "iotgo_debug.h"

#define MYSOCKETSERVER_SUCCESS        0
#define MYSOCKETSERVER_NOT_FINISHED  -1
#define MYSOCKETSERVER_FAIL          -2

typedef struct mySocketServer_interface MySocketServer;

extern MySocketServer *setupSocketServer(uint32_t listen_port);
extern int8_t cleanSocketServer(MySocketServer **pp_mysocket);
extern int8_t waitForClient(MySocketServer *p_mysocket);
extern int32_t readFromClient(MySocketServer *p_mysocket,uint8_t *buf, uint32_t len);
extern int32_t readFromClientNonBlock(MySocketServer *p_mysocket,uint8_t *buf, uint32_t len);
extern int32_t writeToClient(MySocketServer *p_mysocket,uint8_t *buf, uint32_t len);
extern int32_t closeCurrentClient(MySocketServer *p_mysocket);


#endif
